import React, { Component } from 'react'
import { Form, Icon, Input, Button, Checkbox, Card } from 'antd';
import { connect } from 'react-redux'
import { Redirect } from 'react-router-dom'
import { login } from '../../actions/user'
import './login.less'
import { Fragment } from 'react';
const mapState = state => ({
    isLogin: state.user.isLogin,
    isLoading: state.user.isLoading
})

@connect(mapState, { login })
@Form.create()
class Login extends Component {
    handleSubmit = e => {
        e.preventDefault();
        this.props.form.validateFields((err, values) => {
            if (!err) {
                this.props.login(values)
            }
        })
    }

    componentDidMount() {
        const dom = document.getElementById('myCanvas');
    }

    render() {
        const { getFieldDecorator } = this.props.form;
        return (
            <Fragment>
                <canvas className="J_codeimg" id="myCanvas" ></canvas>
            </Fragment>
        )
    }
}

export default Login